home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Games: Greatest Hits 1996
/
Amiga Games: Greatest Hits 1996.iso
/
rexx
/
gridsave.agaiff
< prev
next >
Wrap
Text File
|
1995-06-15
|
2KB
|
102 lines
/* GridSave.agaiff */
address agaiff_rexx
options results
call close 'STDOUT'
call close 'STDIN'
call open 'STDIN','CON:20/20/500/120/AGAiff - GridSaving..'
call pragma '*','STDIN'
call open 'STDOUT','*'
status 0
if result == "" then do
say "No picture loaded.."
address command wait 1
exit
end
say "Grid Block X Size:"
pull gridxs
say "Grid Block Y Size:"
pull gridys
say "Number of Blocks X:"
pull gridxn
say "Number of Blocks Y:"
pull gridyn
say "Add X:"
pull addx
say "Add Y:"
pull addy
say "Start X:"
pull startx
say "Start Y:"
pull starty
say "[1] NumY times top-down or [2] NumX times left-right:"
pull order
say "Do you want to have all blocks joined in one file ? [y/n]"
pull join
if join = "Y" then join=1; else join=0
'requestfile "GridSave - FileName.."'
filename = result
if filename == "" then exit
noshow
abc=0
if order=1 then do
if join=0 then do
do rangex=startx for gridxn BY gridxs+addx
do rangey=starty for gridyn BY gridys+addy
range rangex rangey rangex+gridxs-1 rangey+gridys-1
save filename||"."||abc
abc = abc+1
end
end
end; else do
do rangex=startx for gridxn BY gridxs+addx
do rangey=starty for gridyn BY gridys+addy
range rangex rangey rangex+gridxs-1 rangey+gridys-1
if abc = 0 then save filename
else do
save filename||'.'
address command 'join "'||filename||'" "'||filename||'." AS "'||filename||'.."'
address command 'copy "'||filename||'.." "'||filename||'"'
end
abc = abc+1
end
end
address command 'delete "'||filename||'."'
address command 'delete "'||filename||'.."'
end
end; else do
if join=0 then do
do rangey=starty for gridyn BY gridys+addy
do rangex=startx for gridxn BY gridxs+addx
range rangex rangey rangex+gridxs-1 rangey+gridys-1
save filename||"."||abc
abc = abc+1
end
end
end; else do
do rangey=starty for gridyn BY gridys+addx
do rangex=startx for gridxn BY gridxs+addx
range rangex rangey rangex+gridxs-1 rangey+gridys-1
if abc = 0 then save filename
else do
save filename||'.'
address command 'join "'||filename||'" "'||filename||'." AS "'||filename||'.."'
address command 'copy "'||filename||'.." "'||filename||'"'
end
abc = abc+1
end
end
address command 'delete "'||filename||'."'
address command 'delete "'||filename||'.."'
end
end
reshow